from tkinter import *
from tkinter.messagebox import showinfo


class InputFrame(Frame):
    def __init__(self, master=None):
        Frame.__init__(self, master)
        self.root = master  # 定义内部变量root
        self.time = StringVar()
        self.locate = StringVar()
        self.createPage()

    def createPage(self):
        Label(self, text='账号：').grid(row=2, stick=W, pady=12)
        Entry(self, textvariable=self.time).grid(row=2, column=1, stick=E)
        Label(self, text='密码：').grid(row=3, stick=W, pady=12)
        Entry(self, textvariable=self.locate).grid(row=3, column=1, stick=E)
        Button(self, text='插入', command=self.input1).grid(row=5, column=1, stick=E, pady=10)

    def input1(self):
        showinfo(title='提示', message='工作人员插入成功！')


class QueryFrame(Frame):
    def __init__(self, master=None):
        Frame.__init__(self, master)
        self.root = master  # 定义内部变量root
        self.time = StringVar()
        self.locate = StringVar()
        self.createPage()

    def createPage(self):
        Label(self, text='管理者：').grid(row=2, stick=W, pady=12)
        Entry(self, textvariable=self.time).grid(row=2, column=1, stick=E)
        Label(self, text='地点名称：').grid(row=3, stick=W, pady=12)
        Entry(self, textvariable=self.locate).grid(row=3, column=1, stick=E)
        Button(self, text='增添', command=self.input1).grid(row=5, column=1, stick=E, pady=10)

    def input1(self):
        showinfo(title='提示', message='地点增添成功！')
